use time::OffsetDateTime;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[cfg(feature = "telegram")]
use teloxide_core::types::UserId;
#[derive(Serialize, Deserialize, Debug)]
pub struct User {
    id: Uuid,
#[cfg(feature = "matrix")]
    pub matrix_id: Option<String>,
#[cfg(feature = "telegram")]
    pub telegram_id: Option<UserId>,
#[cfg(feature = "telegram")]
    pub telegram_username: Option<String>,
    pub joined: OffsetDateTime,
    pub show_real_url: bool,
    pub show_alternative_url: bool,
}

// #[derive(Serialize, Deserialize, Debug)]
// pub enum MatrixOrTelegramId<'a>{
// #[cfg(feature = "matrix")]
//     MatrixId(&'a str),
// #[cfg(feature = "telegram")]
//     TelegramId {
//         id: UserId,
//         username: Option<String>
//     },
// }
pub trait UserIdDb{
    type UserId;
    fn user_id(&self) -> Self::UserId;
}
// #[cfg(feature = "telegram")]
// impl UserIdDb for UserId {
//     type UserId = i64;
//     fn user_id(&self) -> Self::UserId {
//         self.0 as i64
//     }
// }
// #[cfg(feature = "telegram")]
// impl UserIdDb for User {
//     fn user_id(&self) -> Self::UserId {
//         self.telegram_id.user_id()
//     }
// }
// #[cfg(feature = "matrix")]
// impl UserIdDb for User {
//     fn user_id(&self) -> Self::UserId {
//         self.matrix_id
//     }
// }